# Maintainer: Giovanni Scafora <giovanni@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=mtools
pkgver=4.0.18
pkgrel=4
pkgdesc="A collection of utilities to access MS-DOS disks"
arch=('x86_64')
url="https://www.gnu.org/software/mtools/"
license=('GPL')
depends=('sh')
makedepends=('texinfo' 'libx11' 'libsm')
optdepends=('libx11: required by floppyd'
	    'libsm:  required by floppyd')
backup=('etc/mtools.conf')
source=("https://ftp.gnu.org/gnu/mtools/${pkgname}-${pkgver}.tar.bz2"
        "https://ftp.gnu.org/gnu/mtools/${pkgname}-${pkgver}.tar.bz2.sig")
validpgpkeys=('E151F8F54AE4F4E9019F037BC80631B26F431961')
md5sums=('a23646617546bf6ad56f061d8b283c85'
         'SKIP')

build() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  sed -i '/^SAMPLE FILE$/s:^:# :' mtools.conf
  ./configure --prefix=/usr \
              --mandir=/usr/share/man \
              --infodir=/usr/share/info \
	      --sysconfdir=/etc
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make -j 1 DESTDIR="${pkgdir}" install
  install -Dm644 mtools.conf "${pkgdir}/etc/mtools.conf"
}
